﻿// PlanetHelper.cs
//
// Copyright (c) 2007 Mike Strobel
//
// This source code is subject to the terms of the Microsoft Reciprocal License (Ms-RL).
// For details, see <http://www.opensource.org/licenses/ms-rl.html>.
//
// All other rights reserved.

using System;

using Supremacy.Utility;

namespace Supremacy.Universe
{
	public static class PlanetHelper
	{
        public static bool IsGaseous(this PlanetType planetType)
        {
            switch (planetType)
            {
                case PlanetType.GasGiant:
                case PlanetType.Crystalline:
                    return true;
                default:
                    return false;
            }
        }
        public static bool IsHabitable(this PlanetType planetType)
        {
            return !planetType.MatchAttribute(UninhabitableAttribute.Default);
        }

        public static bool IsHabitable(this PlanetSize planetSize)
        {
            return !planetSize.MatchAttribute(UninhabitableAttribute.Default);
        }

		public static bool IsHabitable(PlanetType planetType, PlanetSize planetSize)
		{
			return (IsHabitable(planetType) && IsHabitable(planetSize));
		}
	}
}
